package com.hfzy.ihk.web.freeswitchCall.context;


import com.hfzy.ihk.facade.freeswitchCall.service.CloudCallCacheService;
import com.hfzy.ihk.web.freeswitchCall.biz.PushDataToHbaseBiz;
import com.hfzy.ihk.web.freeswitchCall.support.freeswitch.handler.FreeswitchCallOutHandler;
import com.hfzy.ihk.web.freeswitchCall.support.freeswitch.handler.FreeswitchCallStateHandler;
import com.hfzy.ihk.web.freeswitchCall.support.freeswitch.handler.FreeswitchRecordFileHandler;
import org.freeswitch.esl.client.inbound.Client;
import org.springframework.core.task.TaskExecutor;

/**
 * Created by xzz on 2016/6/14.
 */
public class BeanUtils {



    public static DisruptorInitBean getDisruptorInitBean() {
        return (DisruptorInitBean) CloudCallInitializingBean.getApplicationContext().getBean("disruptorInitBean");
    }

    public static TaskExecutor getTaskExecutor(){
        return (TaskExecutor) CloudCallInitializingBean.getApplicationContext().getBean("taskExecutor");
    }

//    public static AliyunCallOutBiz getAliyunCallOutBiz(){
//        return (AliyunCallOutBiz) CloudCallInitializingBean.getApplicationContext().getBean("aliyunCallOutBiz");
//    }
//
//    public static AliyunCallStateBiz getAliyunCallStateBiz(){
//        return (AliyunCallStateBiz) CloudCallInitializingBean.getApplicationContext().getBean("aliyunCallStateBiz");
//    }
//
//    public static AliyunRecordFileBiz getAliyunRecordFileBiz(){
//        return (AliyunRecordFileBiz) CloudCallInitializingBean.getApplicationContext().getBean("aliyunRecordFileBiz");
//    }



    /*public static AliyunCallOutHandler getAliyunCallOutHandler(){
        return (AliyunCallOutHandler) CloudCallInitializingBean.getApplicationContext().getBean("aliyunCallOutHandler");
    }*/

    public static FreeswitchCallOutHandler getFreeswitchCallOutHandler(){
        return (FreeswitchCallOutHandler) CloudCallInitializingBean.getApplicationContext().getBean("freeswitchCallOutHandler");
    }

    public static FreeswitchCallStateHandler getFreeswitchCallStateHandler(){
        return (FreeswitchCallStateHandler) CloudCallInitializingBean.getApplicationContext().getBean("freeswitchCallStateHandler");
    }

    public static Client getEslClient(){

         EventSocketInitBean eventSocketInitBean=(EventSocketInitBean)CloudCallInitializingBean.getApplicationContext().getBean("eventSocketInitBean111");

        return  eventSocketInitBean.getClient();
    }

    public static FreeswitchRecordFileHandler getFreeswitchRecordFileHandler() {

        return (FreeswitchRecordFileHandler) CloudCallInitializingBean.getApplicationContext().getBean("freeswitchRecordFileHandler");
    }



    public static PushDataToHbaseBiz getPushDataToHbaseBiz() {

        return (PushDataToHbaseBiz) CloudCallInitializingBean.getApplicationContext().getBean("pushDataToHbaseBiz");
    }

    public static CloudCallCacheService getCloudCallCacheService() {

        return (CloudCallCacheService) CloudCallInitializingBean.getApplicationContext().getBean("cloudCallCacheService");
    }


   /* public static AliyunAsrCallOutHandler getAliyunAsrCallOutHandler(){
        return (AliyunAsrCallOutHandler) CloudCallInitializingBean.getApplicationContext().getBean("aliyunAsrCallOutHandler");
    }


    public static AliyunCallStateHandler getAliyunCallStateHandler(){
        return (AliyunCallStateHandler) CloudCallInitializingBean.getApplicationContext().getBean("aliyunCallStateHandler");
    }*/


   /* public static AliyunAsrCallStateHandler getAliyunAsrCallStateHandler(){
        return (AliyunAsrCallStateHandler) CloudCallInitializingBean.getApplicationContext().getBean("aliyunAsrCallStateHandler");
    }


    public static AliyunRecordFileHandler getAliyunRecordFileHandler(){
        return (AliyunRecordFileHandler) CloudCallInitializingBean.getApplicationContext().getBean("aliyunRecordFileHandler");
    }

    public static AliyunCallStateBiz getAliyunCallStateBiz(){
        return (AliyunCallStateBiz) CloudCallInitializingBean.getApplicationContext().getBean("aliyunCallStateBiz");
    }*/

}
